<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
?>
<div id="chooseTransactionsDlg" style="display: none;" title="Choose Transaction">
	<div class="select-transaction form">
		<?php
		$this->widget('PsGridView', array(
			'id' => 'select-transaction-grid',
			'dataProvider' => $dataProvider,
			'filter' => $propertyCaseSearch,
			'afterAjaxUpdate' => 'js:prestige.invoice.update.removeEmptyTransactionHeaders',
			'template' => '{items}{pager}{pagesize}',
			'pagerCssClass' => 'pager float-right',
			'pagesizeCssClass' => 'pager-pagesize float-left',
			'htmlOptions' => array(
				'class' => 'grid-view no-shadow'
			),
			'rowCssClassExpression' => '($row % 2 == 0 ? "even" : "odd")',
			'columns' => array(
				array(
					'name' => 'id',
					'type' => 'raw',
					'filter' => false,
					'value' => 'CHtml::radioButton("transGrp", false, array("value" => $data->id))',
					'htmlOptions' => array('width' => '10px'),
				),
				array(
					'header' => 'Property',
					'name' => 'propertyAddress', 
					'type' => 'raw',
					'value' => '$data->property->prop_address_formatted',
					'htmlOptions' => array('width' => '350px', 'class' => 'trans-prop'),
				),
				array(
					'header' => 'Type',
					'name' => 'type',
					'type' => 'raw',
					'value' => '$data->type',
					'htmlOptions' => array('width' => '80px', 'class' => 'trans-type'),
				),
				array(
					'header' => 'Main Agent',
					'name' => 'mainAgentName',
					'type' => 'raw',
					'value' => '$data->mainAgent',
					'htmlOptions' => array('width' => '80px', 'class' => 'trans-agent'),
				),
				array(
					'type' => 'raw',
					'filter' => false,
					'value' => '$data->getEarnCommissionAmount()',
					'htmlOptions' => array('class' => 'trans-comm hidden'),
					'headerHtmlOptions' => array('class' => 'hidden')
				),
				array(
					'type' => 'raw',
					'filter' => false,
					'value' => '$data->getCommissionGstAmount()',
					'htmlOptions' => array('class' => 'trans-gst-amount hidden'),
					'headerHtmlOptions' => array('class' => 'hidden')
				),
				array(
					'type' => 'raw',
					'filter' => false,
					'value' => '$data->comm_gst_payable',
					'htmlOptions' => array('class' => 'trans-gst-payable hidden'),
					'headerHtmlOptions' => array('class' => 'hidden')
				),
				array(
					'type' => 'raw',
					'filter' => false,
					'value' => '$data->gst_rate',
					'htmlOptions' => array('class' => 'trans-gst-rate hidden'),
					'headerHtmlOptions' => array('class' => 'hidden')
				),
			)
		));
		?>
    </div>
</div>